"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
const tiny_entity2_1 = require("tiny-entity2");
const EntityObjectType = tiny_entity2_1.EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
const storeConfig_1 = require("./storeConfig");
const storeExtension_1 = require("./storeExtension");
let Store = class Store extends EntityObjectType {
};
__decorate([
    tiny_entity2_1.Define.PrimaryKey(),
    __metadata("design:type", String)
], Store.prototype, "id", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR,
        DataLength: 32,
        IsIndex: true,
        NotAllowNULL: true
    }),
    __metadata("design:type", String)
], Store.prototype, "userId", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR,
        NotAllowNULL: true
    }),
    __metadata("design:type", String)
], Store.prototype, "userName", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR,
        NotAllowNULL: true
    }),
    __metadata("design:type", String)
], Store.prototype, "name", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR
    }),
    __metadata("design:type", String)
], Store.prototype, "address", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR
    }),
    __metadata("design:type", String)
], Store.prototype, "longitude", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR
    }),
    __metadata("design:type", String)
], Store.prototype, "latitude", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR
    }),
    __metadata("design:type", String)
], Store.prototype, "description", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR,
        DefaultValue: 'normal'
    }),
    __metadata("design:type", String)
], Store.prototype, "status", void 0);
__decorate([
    tiny_entity2_1.Define.Column({ DataType: tiny_entity2_1.Define.DataType.INT, DataLength: 1, DefaultValue: false }),
    __metadata("design:type", Boolean)
], Store.prototype, "isDefault", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.VARCHAR,
        DefaultValue: 'single'
    }),
    __metadata("design:type", String)
], Store.prototype, "type", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.BIGINT
    }),
    __metadata("design:type", Number)
], Store.prototype, "createTime", void 0);
__decorate([
    tiny_entity2_1.Define.Column({
        DataType: tiny_entity2_1.Define.DataType.BIGINT
    }),
    __metadata("design:type", Number)
], Store.prototype, "version", void 0);
__decorate([
    tiny_entity2_1.Define.Mapping({
        Mapping: 'StoreConfig',
        MappingKey: { FKey: 'storeId', MKey: 'id' },
        MappingType: tiny_entity2_1.Define.MappingType.One
    }),
    __metadata("design:type", storeConfig_1.StoreConfig)
], Store.prototype, "storeConfig", void 0);
__decorate([
    tiny_entity2_1.Define.Mapping({
        Mapping: 'StoreExtension',
        MappingKey: { FKey: 'storeId', MKey: 'id' },
        MappingType: tiny_entity2_1.Define.MappingType.One
    }),
    __metadata("design:type", storeExtension_1.StoreExtension)
], Store.prototype, "storeExtension", void 0);
__decorate([
    tiny_entity2_1.Define.Mapping({
        Mapping: 'ImageStore',
        MappingKey: { FKey: 'objectId', MKey: 'id' }
    }),
    __metadata("design:type", Array)
], Store.prototype, "images", void 0);
Store = __decorate([
    tiny_entity2_1.Define.Table({ TableName: 'store' })
], Store);
exports.Store = Store;
exports.StoreStatus = {
    Normal: 'normal',
};
exports.StoreType = {
    Single: 'single',
    Chain: 'chain'
};
